package com.yonyou.brigade.third_parties.bfjr.controller;

import com.yonyou.brigade.order_center.model.ThirdResult;
import com.yonyou.brigade.third_parties.bfjr.service.IBfjrPublicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/bfjr")
public class BfjrDeptInfoController {

    @Autowired
    private IBfjrPublicService bfjrPublicService;

    /**
     * 北方假日部门信OpenServiceImpl息查询
     * @param param
     * @return
     */
    @RequestMapping(value="queryDept",method = RequestMethod.POST)
    @Validated
    public ThirdResult queryBfjrDept (@RequestBody Map param){
        String phone = param.get("phone").toString();
        String tenant = param.get("tenant").toString();
       return  bfjrPublicService.queryDeptInfo(phone,tenant);
    }

    /**
     * 北方假期部门信息删除
     * @param param
     * @return
     */
    @RequestMapping(value="delDept",method = RequestMethod.POST)
    public ThirdResult delBfjrDept (@RequestBody Map param){
        String phone = param.get("phone").toString();
        String tenant = param.get("tenant").toString();
        return  bfjrPublicService.delDeptInfo(phone,tenant);
    }


}
